Triangle $ABC$, $ADE$, and $EFG$ are all equilateral. Points $D$ and $G$ are midpoints of $\overline{AC}$ and $\overline{AE}$, respectively. If $AB=4$, what is the perimeter of figure $ABCDEFG$? [asy]
/* AMC8 2000 #15 Problem */
draw((0,0)--(4,0)--(5,2)--(5.5,1)--(4.5,1));
draw((0,0)--(2,4)--(4,0));
draw((3,2)--(5,2));
label("$A$", (3.7,0), SE);
label("$B$", (0,0), SW);
label("$C$", (2,4), N);
label("$D$", (2.8,2), NE);
label("$E$", (4.8,2), NE);
label("$F$", (5.3,1.05), SE);
label("$G$", (4.3, 1.05), SE);
[/asy]
Answer: We have \begin{align*}
AB+BC+CD+DE+EF+FG+GA&=\\
4+4+2+2+1+1+1&=\boxed{15}\\
\end{align*}